home *** CD-ROM | disk | FTP | other *** search
/ Die Speccy' 97 / Die Speccy' 97.iso / amiga_system / the_aminet / comm / bbs / s342q07.lha / ctdl.h < prev    next >
C/C++ Source or Header  |  1995-05-07  |  44KB  |  1,183 lines

  1. /*
  2. *       Ctdl.h
  3. *
  4. * #include file for all Citadel C files.
  5. * Now includes only #defines and structs.
  6. */
  7. #include "stdio.h"
  8. #include "slist.h"
  9. #include "sysdep.h"
  10. #define CTDL_HEADER     1
  11. /*
  12. *       History
  13. *
  14. * 85Oct16 HAW  Add code for OFFICE-STUFF parameter.
  15. * 85Aug29 HAW  Install code to allow double msg files for autobackup.
  16. * 85Jun19 HAW  Implant exit values so batch files can be made useful.
  17. * 85May27 HAW  Start adding networking gunk.
  18. * 85May22 HAW  MAXLOGTAB now sysop selectable.
  19. * 85May06 HAW  Add daily bailout parameter.
  20. * 85May05 HAW  Add SYSDISK parameter.
  21. * 85Mar20 HAW  Add timestamp code.
  22. * 85Feb21 HAW  Add directory names.
  23. * 85Feb20 HAW  Implement IMPERVIOUS flag.
  24. * 85Feb18 HAW  Insert global variables for baud search.
  25. * 85Jan20 HAW  Insert code to read from system clock.
  26. * 84Aug30 HAW  Begin conversion to MS-DOS.
  27. */
  28. #define NAMESIZE       20       /* length of room names                 */
  29. #define SECTSIZE      128       /* Size of a sector (XMODEM)            */
  30. #define YM_BLOCK_SIZE 1024      /* Size of a sector (YMODEM)            */
  31. typedef char label[NAMESIZE];   /* Semi-generic                         */
  32. /*
  33. * Citadel programs use readSysTab() and writeSysTab() to write an
  34. * image of the external variables in RAM to disk, and later restore
  35. * it.  The image is stored in ctdlTabl.sys .  If ctdlTabl.sys is lost,
  36. * confg.com will automatically reconstruct the hard way when invoked,
  37. * and write a new ctdlTabl.sys out when finished.  CtdlTabl.sys is
  38. * always destroyed after reading, to minimize the possibility of
  39. * reading an out-of-date version.  In general, the technique works
  40. * well and saves time and head-banging on bootup.  You should,
  41. * however, note carefully the following caution:
  42. *  o  Whenever you change the declarations in Ctdl.h you should:
  43. *   -->  destroy the current ctdlTabl.sys file
  44. *   -->  recompile and reload all citadel programs which access
  45. *        ctdlTabl.sys -- currently citadel.com & configur.com
  46. *   -->  use configur.com to build a new ctdlTabl.sys file
  47. *
  48. * If you ignore these warnings, little pixies will prick you in your
  49. * sleep for the rest of your life.
  50. */
  51. struct MiscBool
  52.   {
  53.   BOOLEAN_FLAG(HoldOnLost);   /* Save entries when carrier lost?      */
  54.   BOOLEAN_FLAG(mirror);       /* mirror msg option?                   */
  55.   BOOLEAN_FLAG(unlogEnterOk); /* TRUE if OK to enter messages anon    */
  56.   BOOLEAN_FLAG(unlogReadOk);  /* TRUE if unlogged folks can read mess */
  57.   BOOLEAN_FLAG(unlogLoginOk); /* TRUE if spontan. new accounts ok.    */
  58.   BOOLEAN_FLAG(nonAideRoomOk);/* TRUE general folks can make rooms    */
  59.   BOOLEAN_FLAG(noMail);       /* TRUE if mail is not allowed          */
  60.   BOOLEAN_FLAG(noChat);       /* TRUE if not accepting chats          */
  61.  
  62.   BOOLEAN_FLAG(netParticipant);/* TRUE if participating in the net    */
  63.   BOOLEAN_FLAG(aideSeeAll);   /* TRUE if aides see private rooms      */
  64.   BOOLEAN_FLAG(debug);        /* TRUE for debug phase                 */
  65.   BOOLEAN_FLAG(NetDft);       /* TRUE if new users get net privs      */
  66.   BOOLEAN_FLAG(SysopEditor);  /* TRUE if there is a sysop editor      */
  67.   BOOLEAN_FLAG(IsDoor);       /* TRUE if this installation is a door  */
  68.   BOOLEAN_FLAG(RouteMail);    /* TRUE if we will route mail           */
  69.   BOOLEAN_FLAG(DoorDft);      /* TRUE if new users get door privs     */
  70.  
  71.   BOOLEAN_FLAG(AnonSessions); /* TRUE if anonymous calls are recorded */
  72.   BOOLEAN_FLAG(DL_Default);   /* TRUE if new callers get dl privs     */
  73.   BOOLEAN_FLAG(NetScanBad);   /* TRUE if net msgs scanned for bad words*/
  74.   BOOLEAN_FLAG(QwkMail);      /* TRUE if we support qwk packets        */
  75.   };
  76. /* Let's begin by defining the configuration struct.    */
  77. /* This is part of the contents of ctdltabl.sys         */
  78. typedef struct
  79.   {
  80.   SECTOR_ID maxMSector; /* Max # of sectors (simulated)         */
  81.   MSG_NUMBER oldest;    /* 32-bit ID# of first message in system*/
  82.   MSG_NUMBER newest;    /* 32-bit ID# of last  message in system*/
  83.   UNS_16  nodeName;   /* Offsets in codeBuf                   */
  84.   UNS_16  nodeTitle;
  85.   UNS_16  nodeId;
  86.   UNS_16  nodeDomain;   /* home domain of this installation */
  87.   UNS_16  bRoom;
  88.   UNS_16  MainFloor;    /* Main floor name                      */
  89.   UNS_16  DialPrefixes[7], netSuffix;
  90.   NET_AREA receptArea;        /* Area to accept files sent via net here */
  91.   int  sizeArea;              /* How much room to allow for same (K)  */
  92.   int  maxFileSize;           /* In K                                 */
  93.   label SysopName;
  94.   int  cryptSeed;
  95.   UNS_16 InitColumns;
  96.   UNS_16 LoginAttempts;
  97.   char Audit;                 /* 0=none, 1=normal, 2=no net sessions  */
  98.   DependentData DepData;
  99.   char filter[128];           /* input character translation table    */
  100.   SYS_AREA homeArea,    /* Location: Help files                 */
  101.   msgArea,    /* Message file                         */
  102.   msg2Area,   /* Mirror message file                  */
  103.   logArea,    /* Log file                             */
  104.   roomArea,   /* Room file                            */
  105.   netArea,    /* Net files                            */
  106.   domainArea, /* Domain directories                   */
  107.   auditArea,  /* General auditing                     */
  108.   floorArea,  /* The floor file                       */
  109.   holdArea,   /* Held messages (lost carrier)         */
  110.   tempArea,   /* all temporary files here             */
  111.   bioArea,    /* Biographies here                     */
  112.   bannerArea, /* all banner type files here           */
  113.   QwkWorkArea,/* Current working files: Qwk Mail(unused) */
  114.   QwkName,    /* Current Qwk Packet name              */
  115.   QwkLocation,/* Current Qwk Packet Town name         */
  116.   QwkFileArea;/* Current Qwk Files area               */
  117.   char sysBaud;   /* What's our baud rate going to be?    */
  118.   UNS_16  QwkMaxRooms; /* maximum number of rooms collectable in one packet*/
  119.   UNS_16  QwkMaxPacket;/* maximum number of messages in one packet */
  120.   UNS_16  netSize;    /* How many on the net?                 */
  121.   UNS_16  DomainHandlers; /* How many domains do we service?  */
  122.   UNS_16  MailHub;    /* Who's our mail hub?      */
  123.   UNS_16  MailHubGen;   /*          */
  124.   char    DomainDisplay[11];  /* customizable display of domain names */
  125.   UNS_16 EvNumber;
  126.   /*      stuff to distinguish the various Citadel programs               */
  127.   #define CITADEL         0       /* principal program                    */
  128.   #define xxxxx           1       /* unused                               */
  129.   #define NET             2       /* network downloader                   */
  130.   #define ARCHIVER        3       /* backup program       (future)        */
  131.   #define CONFIGUR        4
  132.   #define UTILITY         5
  133.   char    weAre;              /* set first thing by main()            */
  134.   UNS_16     paramVers;
  135.   /*                      Stuff to size system with:                      */
  136.   /* WARNING!!! if you expand MAXROOMS beyond 128, horrible, horrible     */
  137.   /* things will happen to the userlog entries, which will no longer      */
  138.   /* fit in the assigned 256-byte records and will overwrite things       */
  139.   /* with normally undesirable results. 82Nov10CrT                        */
  140.   UNS_16  MAXLOGTAB,  /* number of log entries supported      */
  141.   MailSlots,
  142.   MsgsPerrm,
  143.   MaxRooms,
  144.   SharedRooms;
  145.   /*              Stuff nowadays usually in bdscio.h:                     */
  146.   /* values for functions to return: */
  147.   #define TRUE            1
  148.   #define FALSE           0
  149.   #define ERROR          -1
  150.   #define SAMESTRING      0       /* value for strcmp() & friend          */
  151.   #define PTR_SIZE        (sizeof (char *))         /* could cause problems */
  152.   /*                      Stuff for rooms:                                */
  153.   #define LOBBY           0       /* Lobby> is >always< room 0.           */
  154.   #define MAILROOM        1       /* Mail>  is >always< room 1.           */
  155.   #define AIDEROOM        2       /* Aide> is >always< room 2.            */
  156.   #define MAXCODE       800
  157.   unsigned char codeBuf[MAXCODE];/* buffer for configuration routines */
  158.   unsigned char scratch[10];  /* scratch space for config routines    */
  159.   AN_UNSIGNED shave[8];       /* shave-and-a-haircut/2 bits pauses    */
  160.   UNS_16  catChar;    /* Location of next write in msg file   */
  161.   SECTOR_ID catSector;
  162.   UNS_16  AnonMailLength; /* anonymous mail max length    */
  163.   UNS_16  sizeLTentry;  /* contains size of a logTab entry      */
  164.   UNS_16  ConTimeOut;   /* seconds in CONSOLE mode before timeout */
  165.   char sysPassword[100];      /* Remote sysop                         */
  166.   char SysopArchive[40];  /* where to archive sysop mail    */
  167.   struct MiscBool BoolFlags;  /* Buncha flags                         */
  168.  
  169.   }
  170. CONFIG;            /* And that's all of the variables we want to save */
  171. /*
  172. *       Room data
  173. */
  174. #define MAXGEN    32       /* five bits of generation=>32 of them */
  175. #define FORGET_OFFSET (MAXGEN / 2)     /* For forgetting rooms  */
  176. #define RO_OFFSET ((MAXGEN / 2) + 4) /* For r/o room write priv */
  177. /* these define what knowRoom() return */
  178. #define UNKNOWN_ROOM  0 /* user does not know of room.    */
  179. #define KNOW_ROOM 1 /* user knows room.     */
  180. #define FORGOTTEN_ROOM  2 /* user has forgotten room.   */
  181. #define WRITE_PRIVS 3 /* user has write privs in r/o room */
  182. #define DEAD_ROOM 4 /* user is looking at dead room   */
  183. #define RO  1   /* temporary for some ifdefs */
  184. #define UN_STACK        40      /* stack of rooms */
  185. #define MSG_BULK        (MSGSPERRM * sizeof (theMessages))
  186. #define RB_SIZE         (sizeof(roomBuf) - (PTR_SIZE * 1))
  187. #define RB_TOTAL_SIZE   (RB_SIZE + MSG_BULK)
  188. struct rflags
  189.   {
  190.   /* Room flags                           */
  191.   BOOLEAN_FLAG(INUSE);        /* Room in use?                         */
  192.   BOOLEAN_FLAG(PUBLIC);       /* Room public?                         */
  193.   BOOLEAN_FLAG(ISDIR);        /* Room directory?                      */
  194.   BOOLEAN_FLAG(PERMROOM);     /* Room permanent?                      */
  195.   BOOLEAN_FLAG(SKIP);         /* Room skipped? (temporary for user)   */
  196.   BOOLEAN_FLAG(UPLOAD);       /* Can room be uploaded to?             */
  197.   BOOLEAN_FLAG(DOWNLOAD);     /* Can room be downloaded from?         */
  198.   BOOLEAN_FLAG(SHARED);       /* Is this a shared room?               */
  199.   BOOLEAN_FLAG(ARCHIVE);      /* Is this room archived somewhere?     */
  200.   BOOLEAN_FLAG(ANON);         /* All messages anonymous?              */
  201.   BOOLEAN_FLAG(NO_NET_DOWNLOAD); /* Accessible via the net for download? */
  202.   BOOLEAN_FLAG(INVITE);
  203.   BOOLEAN_FLAG(AUTO_NET);
  204.   BOOLEAN_FLAG(ALL_NET);
  205.   BOOLEAN_FLAG(READ_ONLY);   /* room is read-only */
  206.   BOOLEAN_FLAG(rflag9);
  207.   BOOLEAN_FLAG(rflag10);
  208.   BOOLEAN_FLAG(rflag11);
  209.   BOOLEAN_FLAG(rflag12);
  210.   BOOLEAN_FLAG(rflag13);
  211.   BOOLEAN_FLAG(rflag14);
  212.   BOOLEAN_FLAG(rflag15);
  213.   BOOLEAN_FLAG(rflag16);
  214.   BOOLEAN_FLAG(rflag17);
  215.  
  216.   };
  217. typedef struct
  218.   {
  219.   /* The summation of a room              */
  220.   AN_UNSIGNED   rtgen;        /* generation # of room                 */
  221.   struct rflags rtflags;      /* public/private flag etc              */
  222.   label         rtname;       /* name of room                         */
  223.   MSG_NUMBER    rtlastMessage;/* # of most recent message in room     */
  224.   MSG_NUMBER    rtlastNet;    /* Highest outgoing net message         */
  225.   char          rtShareType;  /* What type of sharing for this room?  */
  226.   int           rtFlIndex;    /* Index into the floors                */
  227.  
  228.   }
  229. rTable ;                      /* And see ROOMA.C for declaration      */
  230. typedef struct
  231.   {
  232.   MSG_NUMBER rbmsgNo;     /* every message gets unique#           */
  233.   SECTOR_ID rbmsgLoc;     /* sector message starts in             */
  234.  
  235.   }
  236. theMessages;
  237. typedef struct
  238.   {
  239.   /* The appearance of a room:            */
  240.   AN_UNSIGNED   rbgen;  /* generation # of room                 */
  241.   struct rflags rbflags;  /* same bits as flags above             */
  242.   label         rbname; /* name of room                         */
  243.   ROOM_AREA     rbArea; /* area this room is attached to        */
  244.   char          rbShareType;  /* room share type                      */
  245.   UNS_16        rbFlIndex;  /* index into the floors                */
  246.   theMessages *msg;
  247.  
  248.   }
  249. aRoom ;
  250. /*
  251. *       userlog stuff
  252. */
  253. #define CRYPTADD        117    /*                                      */
  254. #define LB_SIZE         (sizeof (logBuf) - (PTR_SIZE * 2))
  255. #define MAIL_BULK       (MAILSLOTS * sizeof (theMessages))
  256. #define GEN_BULK        (MAXROOMS * sizeof (AN_UNSIGNED))
  257. #define LB_TOTAL_SIZE   (LB_SIZE + MAIL_BULK + GEN_BULK)
  258. struct lflags
  259.   {
  260.   /* Flags for person in log              */
  261.   BOOLEAN_FLAG(FLOORS);       /* Unused for now                       */
  262.   BOOLEAN_FLAG(LFMASK);       /* Linefeeds?                           */
  263.   BOOLEAN_FLAG(EXPERT);       /* Expert?                              */
  264.   BOOLEAN_FLAG(AIDE);         /* Vice-Grand-Poobah?                   */
  265.   BOOLEAN_FLAG(L_INUSE);      /* Is this slot in use?                 */
  266.   BOOLEAN_FLAG(TIME);         /* Send time to user of msg creation?   */
  267.   BOOLEAN_FLAG(OLDTOO);       /* Print out last oldmessage on <N>ew?  */
  268.   BOOLEAN_FLAG(NET_PRIVS);    /* User have net privileges?            */
  269.   BOOLEAN_FLAG(RUGGIE);       /* Juvenile? Future fun-ness maybe      */
  270.   BOOLEAN_FLAG(HALF_DUP);     /* half duplex?                   */
  271.   BOOLEAN_FLAG(TWIT);         /* twit?                          */
  272.   BOOLEAN_FLAG(DOOR_PRIVS);   /* door privies?                  */
  273.   BOOLEAN_FLAG(PERMANENT);    /* permanent account?             */
  274.   BOOLEAN_FLAG(DL_PRIVS);     /* sigh                           */
  275.   BOOLEAN_FLAG(ALT_RE);       /* alternative (old-style) .RE    */
  276.   BOOLEAN_FLAG(NoPrompt);     /* message entry prompt           */
  277.   BOOLEAN_FLAG(ANSI);         /* Flag: Ansii enabled:1          */
  278.   BOOLEAN_FLAG(MSG_PAUSE);    /* Flag: Pause between msgs:1     */
  279.   BOOLEAN_FLAG(lflag5);
  280.   BOOLEAN_FLAG(lflag6);
  281.   BOOLEAN_FLAG(lflag7);
  282.   BOOLEAN_FLAG(lflag8);
  283.   BOOLEAN_FLAG(lflag9);
  284.  
  285.   };
  286. #define MAXVISIT        8       /* #visits we remember old newestLo for */
  287. #define GENSHIFT        3       /* Where the generation # is            */
  288. #define CALLMASK        7       /* For finding last visit               */
  289. typedef struct
  290.   {
  291.   /* The appearance of a user:            */
  292.   AN_UNSIGNED   lbnulls;      /* #nulls, lCase, lFeeds                */
  293.   struct lflags lbflags;      /* LFMASK, EXPERT, AIDE, INUSE, etc.    */
  294.   AN_UNSIGNED   lbwidth;      /* terminal width                       */
  295.   int           credit;       /* Credit for long distance calls       */
  296.   label         lbname;       /* caller's name                        */
  297.   label         lbpw;         /* caller's password                    */
  298.   MSG_NUMBER    lbvisit[MAXVISIT];/* newestLo for this and 7 prev. visits */
  299.   long          lblaston;     /* seconds since arbitrary date         */
  300.   AN_UNSIGNED   lbdelay;  /* milliseconds delay     */
  301.   AN_UNSIGNED   *lbgen;/* 5 bits gen, 3 bits lastvisit       */
  302.   theMessages *lbMail;
  303.  
  304.   }
  305. logBuffer ;
  306. typedef struct
  307.   {
  308.   /* Summation of a person:               */
  309.   UNS_16   ltpwhash;    /* hash of password                     */
  310.   UNS_16   ltnmhash;    /* hash of name                         */
  311.   UNS_16   ltlogSlot;   /* location in userlog.buf              */
  312.   MSG_NUMBER ltnewest;        /* last message on last call            */
  313.   char  ltpermanent;    /* permanent account?     */
  314.  
  315.   }
  316. LogTable ;                    /* And see LOG.C for declaration        */
  317. /* this is a mail forwarding structure.  Managed by slist, on   */
  318. /* disk it's known as ctdlfwd.sys.  */
  319. typedef struct
  320.   {
  321.   char *UserName;
  322.   char *System;
  323.   char *Alias;
  324.  
  325.   }
  326. ForwardMail;
  327. /*
  328. *     terminal stuff
  329. */
  330. #define SPECIAL         27      /* <ESC>        console escape char     */
  331. #define CON_NEXT        20      /* ^T           console request char    */
  332. typedef struct
  333.   {
  334.   char *unambig;              /* name of the file */
  335.   char FileDate[8];           /* yymmmdd<0>   */
  336.   long FileSize;              /* size of file */
  337.  
  338.   }
  339. DirEntry;
  340. /*
  341. *   List handling structures - specific.
  342. *   See SLIST.C for generic handling functionality
  343. */
  344. /*
  345. * This structure is used to implement the archival lists.  Each element of
  346. * this sort of list contains two things:
  347. * o The number of the room it is associated with.  There should never be more
  348. *   than one instance of this number in the list.  We should probably attempt
  349. *   to cull out duplicates.  This will be dependent on the behavior of the
  350. *   old LIBARCH code.
  351. * o The name of the file to archive to.
  352. */
  353. typedef struct
  354.   {
  355.   UNS_16 num;
  356.   UNS_16 num2;
  357.   char *string;
  358.  
  359.   }
  360. NumToString;
  361. #define CC_SIZE         140
  362. #define HasCC(x)        ((x)->mbCC.start != NULL)
  363. #define HasOverrides(x) ((x)->mbOverride.start != NULL)
  364. #define SCREEN          0
  365. #define MSGBASE         1
  366. #define TEXTFILE        2
  367. /* this is useful in events and other places */
  368. typedef struct
  369.   {
  370.   UNS_16 first;
  371.   long second;
  372.  
  373.   }
  374. TwoNumbers;
  375. /*
  376. *     message stuff
  377. */
  378. #define MAXTEXT         7500    /* maximum chars in edit buffer         */
  379. #define MAXWORD         256     /* maximum length of a word             */
  380. #define IDIOT_TRIGGER   8       /* Idiot trigger                        */
  381. #define HELD 3
  382. /* output identifications */
  383. #define WHATEVER  0 /* Everything except what we list after */
  384. #define MSGS    1 /* Msg output       */
  385. #define DL_MSGS   2 /* Download messages      */
  386. #define STATIC_MSG_SIZE (sizeof msgBuf - (sizeof msgBuf.mbCC + sizeof msgBuf.mbOverride + sizeof msgBuf.mbtext + sizeof msgBuf.mbInternal + sizeof msgBuf.mbForeign))
  387. #define MoveMsgBuffer(x, y)     memcpy(x, y, (sizeof *x) - PTR_SIZE),(y)->mbForeign.start = (y)->mbCC.start = (y)->mbOverride.start = NULL,strCpy((x)->mbtext, (y)->mbtext);
  388. #define O_NET_PATH_SIZE         100
  389. typedef struct
  390.   {
  391.   /* This is what a msg looks like        */
  392.   int  mbheadChar       ;     /* start of message                     */
  393.   SECTOR_ID     mbheadSector; /* start of message                     */
  394.   char  mbauth[129];    /* name of author                       */
  395.   label mbdate ;    /* creation date                        */
  396.   label mbtime ;    /* creation time                        */
  397.   label mbId   ;    /* local number of message              */
  398.   label mboname;    /* short human name for origin system   */
  399.   label mborig ;    /* US xxx xxx xxxx style ID             */
  400.   label mbroom ;    /* creation room                        */
  401.   label mbsrcId;    /* message ID on system of origin       */
  402.   char  mbto[129];    /* private message to                   */
  403.   char  mbaddr[(NAMESIZE * 2) + 10];/* address of system for net routing    */
  404.   char  mbOther[O_NET_PATH_SIZE];/* OtherNet address                  */
  405.   label mbreply;    /* reply pointer -- Mail only   */
  406.   label mbdomain;   /* home domain of message   */
  407.   SListBase mbCC;   /* lists of CC type people              */
  408.   SListBase mbOverride; /* for overriding the mbto field        */
  409.   SListBase mbInternal; /* for overriding the mbto field        */
  410.   SListBase mbForeign;  /* list of foreign fields   */
  411.   char  *mbtext;    /* buffer text is edited in             */
  412.  
  413.   }
  414. MessageBuffer;
  415. /* values for showMess routine */
  416. #define NEWoNLY         0
  417. #define OLDaNDnEW       1
  418. #define OLDoNLY         2
  419. #define GLOBALnEW       3
  420. #define PHRASE_SIZE     50
  421. typedef struct
  422.   {
  423.   SListBase Users;
  424.   /* char  System[(2 * NAMESIZE) + 10]; */
  425.   char  Phrase[PHRASE_SIZE];
  426.   long  Date;
  427.   char  LocalOnly;
  428.  
  429.   }
  430. OptValues;
  431. /* definitions for determination of net message display */
  432. #define ALL_MESSAGES    0
  433. #define LOCAL_ONLY      1
  434. struct mBuf
  435.   {
  436.   DATA_BLOCK    sectBuf;
  437.   int           thisChar;
  438.   SECTOR_ID     thisSector;
  439.   int           oldChar;
  440.   SECTOR_ID     oldSector;
  441.  
  442.   };
  443. typedef struct
  444.   {
  445.   MSG_NUMBER ltnewest;        /* last message on last call            */
  446.   SECTOR_ID  loc;
  447.  
  448.   }
  449. CheckPoint;
  450. #define CHECKPT   "chkpt"
  451. /*
  452. *     modem stuff
  453. */
  454. #define NEWCARRIER   0x01       /* returned to main prog on login       */
  455. #define CPT_SIGNAL      18      /* ^R                                   */
  456. #define MODEM           0       /* current user of system is            */
  457. #define CONSOLE         1       /* one of these                         */
  458. /*  output XON/XOFF etc flag... */
  459. #define OUTOK           0       /* normal output                        */
  460. #define OUTPAUSE        1       /* a pause has been requested           */
  461. #define OUTNEXT         2       /* quit this message, get the next      */
  462. #define OUTSKIP         3       /* stop current process                 */
  463. #define OUTPARAGRAPH    4       /* skip to next paragraph               */
  464. #define IMPERVIOUS      5       /* make current output unstoppable      */
  465. #define NET_CALL        6       /* net call detected - only banner      */
  466. #define STROLL_DETECTED 7       /* net call detected - only banner      */
  467. #define NEITHER         0       /* don't echo input at all              */
  468. #define CALLER          1       /* echo to caller only --passwords etc  */
  469. #define BOTH            2       /* echo to caller and console both      */
  470. /* These are bit flags passed to string input functions */
  471. #define NO_ECHO         0x01  /* Echo input as X's                    */
  472. #define BS_VALID  0x02  /* return BS_RETURN on BS at zero */
  473. #define QUEST_SPECIAL 0x04  /* question mark is special?    */
  474. #define CR_ON_ABORT 0x08  /* question mark is special?    */
  475. #define TWICE   2 /* for MenuList() - icky kludge   */
  476. /* this is for command acquisition intelligence */
  477. #define TERM  "\001"
  478. #define NTERM "\002"
  479. /* return values for command acquisition */
  480. #define BACKED_OUT  0
  481. #define BAD_SELECT  1
  482. #define GOOD_SELECT 2
  483. /* message manipulation values */
  484. #define NO_CHANGE 0
  485. #define DELETED   1
  486. #define NETTED    2
  487. /* Result code defines, to be returned by system dependent functions */
  488. #define R_300           0
  489. #define R_1200          1
  490. #define R_2400          2
  491. #define R_4800          3
  492. #define R_9600          4
  493. #define R_14400         5
  494. #define R_19200         6
  495. #define R_38400         7
  496. #define R_57600         8
  497. #define R_RING          9
  498. #define R_DIAL         10
  499. #define R_NODIAL       11
  500. #define R_AOK          12
  501. #define R_NOCARR       13
  502. #define R_BUSY         14
  503. /*
  504. *     event stuff
  505. */
  506. #define SUNDAYS         1
  507. #define MONDAYS         2
  508. #define TUESDAYS        4
  509. #define WEDNESDAYS      8
  510. #define THURSDAYS       16
  511. #define FRIDAYS         32
  512. #define SATURDAYS       64
  513. #define ALL_DAYS        127     /* 0x7F */
  514. /* event types */
  515. #define TYPREEMPT       0
  516. #define TYNON           1
  517. #define TYQUIET         2
  518. /* event classes */
  519. #define CLNET           0
  520. #define CLEXTERN        1
  521. #define CLREL           2
  522. #define CL_DL_TIME      3
  523. #define CL_ANYTIME_NET  4
  524. #define CL_DOOR_TIME    5
  525. #define CL_AUTODOOR     6
  526. #define CL_CHAT_ON  7
  527. #define CL_CHAT_OFF 8
  528. #define CL_REDIRECT 9
  529. #define CL_NEWUSERS_ALLOWED 10
  530. #define CL_NEWUSERS_DISALLOWED  11
  531. #define CL_UNTIL_NET  12
  532. #define CL_NETCACHE 13
  533. /* number of event classes supported */
  534. #define EVENT_CLASS_COUNT 14
  535. #define ALL_NETS        ~(0l)
  536. #define MAX_NET         32
  537. #define NO_NETS         0l
  538. #define PRIORITY_MAIL (1l << 31)
  539. typedef struct
  540.   {
  541.   int            EvDur,               /* Event duration       */
  542.   EvWarn;              /* Event warning pointer*/
  543.   unsigned char  EvClass,             /* Event Class          */
  544.   EvType;              /* Event Type           */
  545.   MULTI_NET_DATA EvExitVal;           /* Event Exit value     */
  546.   UNS_16         EvMinutes;           /* From midnight        */
  547.   union
  548.     {
  549.     struct
  550.       {
  551.       long       EvDeadTime;      /* Anytime netting      */
  552.       int        EvAnyDur;        /* Anytime netting      */
  553.  
  554.       }
  555.     Anytime;
  556.     label      EvUserName;          /* Autodoor target acct */
  557.     struct
  558.       {
  559.       /* Redirect incoming  */
  560.       label EvSystem;   /* Valid system   */
  561.       char  EvFilename[MAX_FILENAME]; /* incoming file */
  562.       int   EvHomeDir;    /* points into codeBuf  */
  563.  
  564.       }
  565.     Redirect;
  566.  
  567.     }
  568.   vars;
  569.  
  570.   }
  571. EVENT;
  572. /*
  573. * net stuff
  574. */
  575. /* SYSBAUD constants    */
  576. #define ONLY_300        0       /* 300 baud only                        */
  577. #define BOTH_300_1200   1       /* +1200 baud                           */
  578. #define TH_3_12_24      2       /* +2400 baud                           */
  579. #define B_4             3       /* +4800 baud                           */
  580. #define B_5             4       /* +9600 baud                           */
  581. #define B_6             5       /* 14400 baud                           */
  582. #define B_7             6       /* 19200 baud                           */
  583. #define B_8             7       /* 38400 baud                           */
  584. #define B_9             8       /* 57600 baud                           */
  585. /* ITL constants        */
  586. #define ITL_SUCCESS     0
  587. #define ITL_BAD_TRANS   1
  588. #define ITL_NO_OPEN     2
  589. /* Network request codes        */
  590. #define HANGUP          0       /* Terminate networking                 */
  591. #define NORMAL_MAIL     1       /* Send normal Mail                     */
  592. #define R_FILE_REQ      2       /* Request a single file                */
  593. #define A_FILE_REQ      3       /* Request a number of files            */
  594. #define NET_ROOM        5       /* Send a shared room                   */
  595. #define CHECK_MAIL      6       /* Check for recipient validity         */
  596. #define SEND_FILE       7       /* Send a file to another system        */
  597. #define NET_ROUTE_ROOM  8       /* Send a routed shared room            */
  598. #define ROUTE_MAIL      9       /* Send route mail                      */
  599. #define ITL_COMPACT 10  /* Compact messages during transfer */
  600. #define FAST_MSGS 21  /* Mass transfer      */
  601. #define ITL_PROTOCOL    100     /* Switch to different protocol         */
  602. #define ROLE_REVERSAL   201     /* Reverse roles                        */
  603. #define SYS_NET_PWD     202     /* System password stuff                */
  604. #define BAD             0       /* Reply Codes: this indicates bad      */
  605. #define GOOD            1       /* And this indicates good              */
  606. /* These refer to negative ack mail     */
  607. #define NO_ERROR        0       /* No error (ends transmission)         */
  608. #define NO_RECIPIENT    1       /* No recipient found                   */
  609. #define BAD_FORM        2       /* Something's wrong                    */
  610. #define UNKNOWN         99      /* Something's REALLY wrong (eek!)      */
  611. #define PEON            0
  612. #define REG_HOST        1
  613. #define BACKBONE        2       /* Kinda like a hub     */
  614. #define PASS_BACKBONE   3       /* Used in "mode" only, not rbSharedType */
  615. #define ACTIVE_BACKBONE 4
  616. /* These used with ITL_PROTOCOL command         */
  617. #define XM_ITL          "0"
  618. #define YM_ITL          "1"
  619. #define WXM_ITL         "2"
  620. /* These are used with ITL_COMPACT command  */
  621. #define COMPACT_1 "0"
  622. #define NET_GEN         32
  623. #define NON_NET   0
  624. #define NORMAL_NET  1
  625. #define ANYTIME_NET 2
  626. #define ANY_CALL  3
  627. #define STROLL_CALL 4       /* net call detected - only banner      */
  628. #define UNTIL_NET 5
  629. #define NET_CACHE 6
  630. #define NOT_SYSTEM      0
  631. #define BAD_FORMAT      1
  632. #define NO_SYSTEM       2
  633. #define IS_SYSTEM       3
  634. #define SYSTEM_IS_US  4
  635. /* domain function responses  */
  636. #define REFUSE    0
  637. #define OURS    1
  638. #define LOCALROUTE  2
  639. #define DOMAINFILE  3
  640. /* domain file upload results */
  641. #define DOMAIN_SUCCESS  0
  642. #define DOMAIN_FAILURE  1
  643. /* route mail send errors */
  644. #define NO_SUCH_FILE  0
  645. #define REFUSED_ROUTE 1
  646. #define GOOD_SEND 2
  647. #define UNKNOWN_ERROR 3
  648. /* netController() flag values -- OR these values together */
  649. #define REPORT_FAILURE  0x01
  650. #define LEISURELY 0x02
  651. /*
  652. * this structure is the flags attached to a node
  653. */
  654. struct nflags
  655.   {
  656.   /* Any and all reasons to call this node*/
  657.   BOOLEAN_FLAG(normal_mail);  /* Outgoing normal mail?                */
  658.   BOOLEAN_FLAG(in_use);       /* Is this record even in use?          */
  659.   BOOLEAN_FLAG(room_files);   /* Any file requests?                   */
  660.   BOOLEAN_FLAG(local);        /* Is this node local?                  */
  661.   BOOLEAN_FLAG(spine);        /* Will we be a spine?                  */
  662.   BOOLEAN_FLAG(send_files);
  663.   BOOLEAN_FLAG(is_spine);     /* Is that system a spine?              */
  664.   BOOLEAN_FLAG(OtherNet);
  665.   BOOLEAN_FLAG(HasRouted);
  666.   BOOLEAN_FLAG(RouteFor);
  667.   BOOLEAN_FLAG(RouteTo);
  668.   BOOLEAN_FLAG(Stadel);
  669.   BOOLEAN_FLAG(RouteLock);
  670.   BOOLEAN_FLAG(ExternalDialer);
  671.   BOOLEAN_FLAG(NoDL);
  672.   BOOLEAN_FLAG(MassTransfer);
  673.   BOOLEAN_FLAG(Lzh);             /* Amiga update */
  674.   BOOLEAN_FLAG(Zoo);
  675.   BOOLEAN_FLAG(Arc);
  676.   BOOLEAN_FLAG(Lha);
  677.  
  678.   };
  679. #define GetMode(x)  ((x) & 7)
  680. #define SetMode(x, y) x = (x & (~7)) + y;
  681. #define GetFA(x)  ((x) & 8)
  682. #define SetFA(x)  x |= 8;
  683. #define UnSetFA(x)  x &= (~8);
  684. #define CACHE_END_NAME    "%d.msg"
  685. #define V_CACHE_END_NAME  "v%d.msg"
  686. #define RECOVERY_FILE "incase.net"
  687. #define FAST_TRANS_FILE "\001\002\003"
  688. typedef struct
  689.   {
  690.   char        *addr1, *addr2, *addr3;
  691.   MSG_NUMBER  HiSent;
  692.   int (*sendfunc)(int x);
  693.  
  694.   }
  695. NetInfo;
  696. typedef struct
  697.   {
  698.   MSG_NUMBER lastMess;        /* Highest net message in this room     */
  699.   unsigned   srgen;           /* High bit of gen is used flag         */
  700.   unsigned   srslot;
  701.   int        mode;    /* low 3 bits is mode, fourth bit tells */
  702.   /* if there's a file of msgs to send  */
  703.  
  704.   }
  705. SharedRoom;
  706. #define NT_SIZE         (sizeof (*netTab) - (PTR_SIZE))
  707. #define NB_SIZE         (sizeof (netBuf)  - (PTR_SIZE))
  708. #define SR_BULK         (SHARED_ROOMS * sizeof (SharedRoom))
  709. #define NT_TOTAL_SIZE   (NT_SIZE + SR_BULK)
  710. #define NB_TOTAL_SIZE   (NB_SIZE + SR_BULK)
  711. typedef struct
  712.   {
  713.   label          netId;       /* Node id      */
  714.   label          netName;     /* Node name    */
  715.   char           nbShort[3];  /* short hand */
  716.   label          OurPwd;
  717.   label          TheirPwd;
  718.   MULTI_NET_DATA MemberNets;
  719.   struct nflags  nbflags;     /* Flags        */
  720.   char           baudCode;    /* Baud code for this node   */
  721.   char           nbGen;       /* Generation value for this node */
  722.   char           access[40];  /* For alternative access       */
  723.   int      nbRoute;     /* what system do we route via? */
  724.   UNS_16     nbRouteGen;     /* what system do we route via? */
  725.   UNS_16     nbHiRouteInd;        /* internal housekeeping        */
  726.   unsigned long  nbLastConnect; /* last connection with this system */
  727.   SharedRoom *netRooms;
  728.  
  729.   }
  730. NetBuffer;
  731. typedef struct
  732.   {
  733.   int            ntnmhash;
  734.   int            ntidhash;
  735.   char           ntShort[3];
  736.   struct nflags  ntflags ;
  737.   MULTI_NET_DATA ntMemberNets;
  738.   char           ntGen;
  739.   SharedRoom     *netTRooms;
  740.  
  741.   }
  742. NetTable;
  743. struct cmd_data
  744.   {
  745.   /* Commands for networking              */
  746.   AN_UNSIGNED command;
  747.   char        fields[4][NAMESIZE];
  748.  
  749.   };
  750. struct netMLstruct
  751.   {
  752.   MSG_NUMBER ML_id;
  753.   SECTOR_ID  ML_loc;
  754.  
  755.   };
  756. struct fl_req
  757.   {
  758.   label room;
  759.   label roomfile;
  760.   NET_AREA flArea;
  761.   label filename;
  762.  
  763.   };
  764. struct fl_send
  765.   {
  766.   NET_AREA snArea;
  767.   label sFilename;
  768.  
  769.   };
  770. /*
  771. * Error values for reasons on not sharing
  772. */
  773. #define NO_ROOM   0
  774. #define NOT_SHARING 1 /* not a shared room */
  775. #define NOT_SHARED  2 /* not sharing with you */
  776. #define NO_PWD    3
  777. #define FOUND   4
  778. typedef struct
  779.   {
  780.   label Room;   /* this is the target */
  781.   char  virtual;  /* the rest contains results */
  782.   int   room;
  783.   int   index;
  784.   char  reason;
  785.  
  786.   }
  787. RoomSearch;
  788. /*
  789. *     Floor data structures
  790. */
  791. /* Display modes for floor summaries    */
  792. #define INT_EXPERT      0       /* First display for experts            */
  793. #define INT_NOVICE      1       /* First display for novices            */
  794. #define ONLY_FLOORS     2       /* Floors only, no rooms 'tall.         */
  795. #define NOT_INTRO       3       /* 'K' is done.                         */
  796. #define FORGOTTEN       4       /* Forgotten rooms list                 */
  797. #define MATCH_SEL       10
  798. #define DR_SEL          11
  799. #define SH_SEL          12
  800. #define PR_SEL          13
  801. #define ANON_SEL        14
  802. #define READONLY        15
  803. struct floor
  804.   {
  805.   label FlName;
  806.   char  FlInuse;
  807.   label FlModerator;
  808.  
  809.   };
  810. /*
  811. *     Exit values for errorlevels
  812. */
  813. #define SYSOP_EXIT              0        /* "Normal"     */
  814. #define RECURSE_EXIT            1
  815. #define CRASH_EXIT              2
  816. #define REMOTE_SYSOP_EXIT       3
  817. #define DOOR_EXIT               4
  818. /*
  819. *     Useful psuedo functions
  820. */
  821. #define onLine()        (haveCarrier    ||   onConsole)
  822. #define wrNetId(x)      ((strCmpU(x, ALL_LOCALS) != 0) ? x : WRITE_LOCALS)
  823. #define putMLNet(f,b)   if (fwrite(&b, sizeof(b), 1, f) != 1)\
  824. crashout("putMLNet crash")
  825. #define getMLNet(f,b)   (fread(&b, sizeof(b), 1, f) == 1)
  826. #define putSLNet(b, f)  if (fwrite(&b, sizeof(b), 1, f) != 1)\
  827. crashout("putSLNet crash")
  828. #define getSLNet(b, f)  (fread(&b, sizeof(b), 1, f) == 1)
  829. #define TheSysop()      (aide && strCmpU(cfg.SysopName, logBuf.lbname) == SAMESTRING && onConsole)
  830. #define SomeSysop()     (TheSysop() || (remoteSysop && strCmpU(cfg.SysopName, logBuf.lbname) == SAMESTRING))
  831. #define HalfSysop()     (aide && (remoteSysop || onConsole))
  832. #define setNeedsProcessing(i)   netBuf.netRooms[i].srslot |= 0x8000
  833. #define chkNeedsProcessing(i)   (netBuf.netRooms[i].srslot & 0x8000)
  834. #define resetNeedsProcessing(i) netBuf.netRooms[i].srslot &= 0x7FFF
  835. #define isSharedRoom(h, i)      (netTab[h].netTRooms[i].srgen & 0x8000)
  836. #define resetNetRoomFlag(i)     netBuf.netRooms[i].srgen &= 0x7FFF;\
  837. netTab[thisNet].netTRooms[(i)].srgen &= 0x7FFF;
  838. #define netRoomSlot(i)          (netBuf.netRooms[i].srslot & 0x7FFF)
  839. #define netTabRoomSlot(h, i)    (netTab[h].netTRooms[i].srslot & 0x7FFF)
  840. #define netGen(h, i)            (netTab[h].netTRooms[i].srgen & 0x7FFF)
  841. #define roomValidate(h, i)  (roomTab[netTabRoomSlot(h, i)].rtgen==netGen(h,i) \
  842. && roomTab[netTabRoomSlot(h, i)].rtflags.INUSE \
  843. && roomTab[netTabRoomSlot(h, i)].rtflags.SHARED)
  844. #define INTERVALS 8             /* Half second intervals                */
  845. #define minimum(x,y)    ((x) < (y) ? (x) : (y))
  846. /* #define max(x,y)        ((x) > (y) ? (x) : (y)) */
  847. #define initLogBuf(x)   (x)->lbgen = (AN_UNSIGNED *) special_GetDynamic(GEN_BULK,__FILE__, __LINE__),\
  848. (x)->lbMail = (theMessages *)special_GetDynamic(MAIL_BULK, __FILE__, __LINE__)
  849. #define killLogBuf(x)   free((x)->lbgen), free((x)->lbMail)
  850. #define initRoomBuf(x)  (x)->msg = (theMessages *)special_GetDynamic(max(MAIL_BULK, MSG_BULK), __FILE__, __LINE__)
  851. #define killRoomBuf(x)  free((x)->msg)
  852. #define initNetBuf(x)   (x)->netRooms = (SharedRoom *)special_GetDynamic(sizeof (*(x)->netRooms) * SHARED_ROOMS, __FILE__, __LINE__)
  853. #define killNetBuf(x)   free((x)->netRooms)
  854. #define NumElems(x)     (sizeof (x)) / (sizeof (x[0]))
  855. #define copyLogBuf(x, y)  memcpy(y, x, LB_SIZE),\
  856. memcpy((y)->lbMail, (x)->lbMail, MAIL_BULK),\
  857. memcpy((y)->lbgen, (x)->lbgen, GEN_BULK)
  858. #define HasPriorityMail(n)  (netTab[n].ntMemberNets & PRIORITY_MAIL)
  859. extern int ClassActive[];
  860. #define Dl_Limit_On()   (ClassActive[CL_DL_TIME])
  861. #define Door_Limit_On() (ClassActive[CL_DOOR_TIME])
  862. extern char **ValidMenuOpts, *Menu;
  863. #define RegisterThisMenu(x, y)      Menu = x, ValidMenuOpts = y;
  864. #define NodeDisabled(x) (!(netTab[x].ntMemberNets & ALL_NETS))
  865. #define CompExtension(CompType)    Formats[(CompType) - 1].Format
  866. /*
  867. *     Call log stuff
  868. */
  869. #define BAUD            0       /* This message concerns baud rate      */
  870. #define L_IN            1       /*  "      "       "     login          */
  871. #define L_OUT           2       /*  "      "       "     logout         */
  872. #define CARRLOSS        3       /*  "      "       "     carr-loss      */
  873. #define FIRST_IN        4       /*  "      "       "     init           */
  874. #define LAST_OUT        5       /*  "      "       "     close-down     */
  875. #define EVIL_SIGNAL     6       /*  "      "       "     user errors    */
  876. #define CRASH_OUT       7       /*  "      "       "     crash down     */
  877. #define INTO_NET        8       /*  "      "       "     net entry      */
  878. #define OUTOF_NET       9       /*  "      "       "     net exit       */
  879. #define DOOR_RETURN     10      /*  "      "       "     door returns   */
  880. #define DOOR_OUT        11      /*  "      "       "     door exits     */
  881. #define BADWORDS_SIGNAL 12      /*  "      "       "     bad words      */
  882. #define TRIED_CHAT      13      /*  "      "       "     chat attempts  */
  883. #define FL_START        0       /* starting a file transfer             */
  884. #define FL_FAIL         1       /* file transfer failed                 */
  885. #define FL_SUCCESS      2       /* file transfer success                */
  886. #define FL_EX_END       3       /* external file transfer finish        */
  887. /*
  888. *     Transfer protocol constants
  889. */
  890. #define ASCII           0
  891. #define XMDM            1
  892. #define YMDM            2
  893. #define WXMDM           3
  894. #define TOP_PROTOCOL  WXMDM
  895. #define InternalProtocol(x) (x >= 0 && x <= TOP_PROTOCOL)
  896. #define MAX_WX_ERRORS   10
  897. #define ERRORMAX        10       /* How many errors to suffer through   */
  898. #define RETRYMAX        10
  899. #define MINUTE          60       /* How long is a minute?               */
  900. #define STARTUP         1        /* Code to start a transfer            */
  901. #define FINISH          2        /* Code to cleanup a transfer          */
  902. /* Reception startup error values */
  903. #define TRAN_SUCCESS    0       /* Successful transfer                  */
  904. #define NO_LUCK         1       /* Never return this to caller          */
  905. #define CANCEL          2       /* Session encountered a CAN            */
  906. #define NO_START        3       /* Transfer never even started!         */
  907. #define TRAN_FAILURE    4       /* Something blew...                    */
  908. /* Internally used values, not returned to caller       */
  909. #define NO_ERROR        0
  910. #define BAD_DLE         1
  911. #define EARLY_SYN       2
  912. #define DATA_TIMEOUT    3
  913. #define BAD_CRC         4
  914. #define BAD_CKSM        5
  915. #define BAD_SEC_COMP    6
  916. #define SYNCH_ERROR     7       /* Fatal */
  917. #define WRITE_ERROR     8       /* Fatal */
  918. #define CARR_LOSS       9       /* Fatal */
  919. /* Internal WXMODEM enumerations for transmission window */
  920. #define NOT_USED        0
  921. #define SECTOR_READY    1
  922. #define SENT            2
  923. #define ACKED           3
  924. /* ASCII characters: */
  925. #define SOH             1
  926. #define STX             2
  927. #define CNTRLC          3
  928. #define CNTRLD          4      /* control D character */
  929. #define EOT             4
  930. #define ETX   3
  931. #define ACK             6
  932. #define BELL            7
  933. #define BACKSPACE       8
  934. #define CNTRLI          9       /* aka tab                              */
  935. #define TAB             9       /* aka ^I                               */
  936. #define NEWLINE        10       /* "linefeed" to philistines.           */
  937. #define CNTRLl         12       /* Sysop privileges                     */
  938. #define CNTRLO         15
  939. #define DLE            16
  940. #define XON            17
  941. #define XOFF           19       /* control-s                            */
  942. #define NAK            21
  943. #define SYN            22
  944. #define CAN            24
  945. #define CNTRLZ         26
  946. #define CPMEOF     CNTRLZ
  947. #define ESC            27       /* altmode                              */
  948. #define CRC_START     'C'       /* CRC Mode for WC                      */
  949. #define DEL          0x7F       /* delete char                          */
  950. #define IS_NUMEROUS     0x01
  951. #define IS_DL           0x02
  952. #define NEEDS_FIN       0x04
  953. #define RIGAMAROLE      0x08
  954. #define NOT_AVAILABLE   0x10
  955. #define NEEDS_HDR       0x20    /* True only for file transfer          */
  956. typedef struct
  957.   {
  958.   char *GenericName;
  959.   UNS_16  KludgeFactor;
  960.   UNS_16  flags;                 /* Bit map - see above */
  961.   char *name;
  962.   char *MsgTran;
  963.   char *BlbName;
  964.   char *UpBlbName;
  965.   int  (*method)(int c);
  966.   UNS_16 BlockSize;
  967.   int  (*SendHdr)(long fileSize, char *fileName);
  968.   int  (*CleanUp)(void);
  969.  
  970.   }
  971. PROTO_TABLE;
  972. typedef struct
  973.   {
  974.   UNS_16 ThisBlock;      /* Block # of this block */
  975.   AN_UNSIGNED *buf;
  976.   CRC_TYPE ThisCRC;        /* So we only calculate once */
  977.   char status;        /* Init these to NOT_USED */
  978.  
  979.   }
  980. TransferBlock;
  981. #define NORMAL          0
  982. #define DISK            1
  983. /*
  984. * Compression types for use in netting
  985. */
  986. #define NO_COMP   -1
  987. #define LHA_COMP  1
  988. #define LZH_COMP  2
  989. #define ZOO_COMP  3
  990. #define ARC_COMP  4
  991. #define COMP_MAX  ARC_COMP
  992. /*
  993. * Protocols for Mass Transfers
  994. */
  995. #define DEFAULT_PROTOCOL  -1
  996. #define XM_PROTOCOL   0
  997. #define YM_PROTOCOL   1
  998. #define WX_PROTOCOL   2
  999. #define ZM_PROTOCOL   3
  1000. /*
  1001. * Table for decoding funny files
  1002. */
  1003. typedef struct
  1004.   {
  1005.   char *Format;
  1006.   char Many;
  1007.   char (*Func)(FILE *fd, ...);
  1008.  
  1009.   }
  1010. FunnyInfo;
  1011. extern FunnyInfo Formats[];
  1012. /*
  1013. *     SEA ARC reading structure
  1014. */
  1015. typedef struct
  1016.   {
  1017.   char   ArchiveMark;
  1018.   char   Header;
  1019.   char name [13];     /* file name */
  1020.   UNS_32 size;        /* size of compressed file */
  1021.   UNS_16 date;        /* file date*/
  1022.   UNS_16 time;        /* file time */
  1023.   UNS_16 crc;         /* cyclic redundancy check */
  1024.   UNS_32 length;      /* true file length */
  1025.  
  1026.   }
  1027. ARCbuf;
  1028. /*
  1029. *     PK ZIP header structure
  1030. */
  1031. typedef struct
  1032.   {
  1033.   UNS_32 Signature;
  1034.   UNS_16 ExtVersion;
  1035.   UNS_16 BitFlags;
  1036.   UNS_16 Method;
  1037.   UNS_16 FileTime;
  1038.   UNS_16 FileDate;
  1039.   UNS_32 CRC;
  1040.   UNS_32 CompSize;
  1041.   UNS_32 NormalSize;
  1042.   UNS_16 NameLength;
  1043.   UNS_16 FieldLength;
  1044.  
  1045.   }
  1046. ZipHeader;
  1047. /*
  1048. *     ZOO header information
  1049. * These structures were taken directly from Rahul Dhesi's code
  1050. * and are under his copyright.
  1051. */
  1052. #define SIZ_TEXT  20                   /* Size of header text */
  1053. #define FNAMESIZE 13                   /* Size of DOS filename */
  1054. #define LFNAMESIZE 256                 /* Size of long filename */
  1055. #define PATHSIZE 256                   /* Max length of pathname */
  1056. typedef struct
  1057.   {
  1058.   char text[SIZ_TEXT];
  1059.   UNS_32 zoo_tag;
  1060.   UNS_32 zoo_start;
  1061.   UNS_32 zoo_minus;
  1062.   char major_ver;
  1063.   char minor_ver;
  1064.   char type;
  1065.   UNS_32 acmt_pos;
  1066.   UNS_16 acmt_len;
  1067.   UNS_16 vdata;
  1068.  
  1069.   }
  1070. zoo_header;
  1071. typedef struct
  1072.   {
  1073.   UNS_32 zoo_tag;
  1074.   char type;
  1075.   char packing_method;
  1076.   UNS_32 next;
  1077.   UNS_32 offset;
  1078.   UNS_16 date;
  1079.   UNS_16 time;
  1080.   UNS_16 file_crc;
  1081.   UNS_32 org_size;
  1082.   UNS_32 size_now;
  1083.   char major_ver;
  1084.   char minor_ver;
  1085.   char deleted;
  1086.   char struc;
  1087.   UNS_32 comment;
  1088.   UNS_16 cmt_size;
  1089.   char fname[FNAMESIZE];
  1090.   UNS_16 var_dir_len;
  1091.   char tz;
  1092.   UNS_16 dir_crc;
  1093.   /* fields for variable part of directory entry follow */
  1094.   char namlen;
  1095.   char dirlen;
  1096.   char lfname[LFNAMESIZE];
  1097.   char dirname[PATHSIZE];
  1098.   UNS_16 system_id;
  1099.   UNS_32 fattr;
  1100.   UNS_16 vflag;
  1101.   UNS_16 version_no;
  1102.  
  1103.   }
  1104. zoo_direntry;
  1105. /*
  1106. *     LHA/LZH structure information
  1107. *     courtesy Daniel Durbin
  1108. */
  1109. typedef struct
  1110.   {
  1111.   /* Local file header */
  1112.   char unknown1[2];   /* ? */
  1113.   char method[5];     /* compression method */
  1114.   UNS_32 csize;     /* compressed size */
  1115.   UNS_32 fsize;     /* uncompressed size */
  1116.   UNS_16 ftime;     /* last mod file time (msdos format) */
  1117.   UNS_16 fdate;     /* last mod file date */
  1118.   char fattr;     /* file attributes */
  1119.   char unknown2;      /* ? */
  1120.   char namelen;     /* filename length */
  1121.  
  1122.   }
  1123. LZHead;
  1124. /*
  1125. *     Gif header information
  1126. */
  1127. typedef struct
  1128.   {
  1129.   char   Sig[6];  /* no null */
  1130.   UNS_16 Width;
  1131.   UNS_16 Height;
  1132.   char   Colors;
  1133.  
  1134.   }
  1135. GifHeader;
  1136. /*
  1137. *     Timer Assignments
  1138. */
  1139. #define WORK_TIMER      0       /* scratch timer        */
  1140. #define NEXT_ANYNET     1
  1141. #define USER_TIMER      2
  1142. #define NET_SESSION     3
  1143. /*
  1144. *     Multi-tasking (OS) defines
  1145. */
  1146. #define INUSE_PAUSE 0
  1147. #define IDLE_PAUSE  1
  1148. #define NET_PAUSE 2
  1149. #define CHAT_NICE 3
  1150. /*
  1151. *     Data Entry Types
  1152. */
  1153. #define MSG_ENTRY 0
  1154. #define FILE_ENTRY  1
  1155. #define INFO_ENTRY  2
  1156. #define BIO_ENTRY 3
  1157. /*
  1158. *     Finger saving defines
  1159. */
  1160. #define termWidth       logBuf.lbwidth
  1161. #define termNulls       logBuf.lbnulls
  1162. #define termLF          logBuf.lbflags.LFMASK
  1163. #define expert          logBuf.lbflags.EXPERT
  1164. #define aide            logBuf.lbflags.AIDE
  1165. #define sendTime        logBuf.lbflags.TIME
  1166. #define oldToo          logBuf.lbflags.OLDTOO
  1167. #define FloorMode       logBuf.lbflags.FLOORS
  1168. #define HalfDup         logBuf.lbflags.HALF_DUP
  1169. #define thisFloor       roomBuf.rbFlIndex
  1170. #define DoorPriv        logBuf.lbflags.DOOR_PRIVS
  1171. #define MAILSLOTS       cfg.MailSlots
  1172. #define MSGSPERRM       cfg.MsgsPerrm
  1173. #define MAXROOMS        cfg.MaxRooms
  1174. #define SHARED_ROOMS    cfg.SharedRooms
  1175. /*
  1176. * This is icky, and should be a lesson to all would-be
  1177. * header writers.
  1178. */
  1179. #include "ctdlvirt.h"
  1180. #include "ctdlansi.h"
  1181. #include "ansisys.h"
  1182. /* And that's it for this file */
  1183.